package com.mervyn.observer;

import java.util.ArrayList;
import java.util.List;

public class Subject {
    private List<Observer> obss = new ArrayList<>();

    public void registe(Observer obs){
        obss.add(obs);
    }

    public void changeState(){
        notifiAll();
    }

    public void notifiAll(){
        obss.forEach(Observer::update);
    }

}
